home *** CD-ROM | disk | FTP | other *** search
Wrap
-- card: 3517 from stack: in -- bmap block id: 3586 -- flags: 0000 -- background id: 2603 -- name: ----- HyperTalk script ----- on opencard global firsttime put 1 into firsttime set visible of cd fld "about" to false end opencard -- part 1 (button) -- low flags: 00 -- high flags: 8004 -- rect: left=386 top=18 right=40 bottom=486 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: graph ----- HyperTalk script ----- on mouseup global firsttime if firsttime > 1 then cleanup drawgraph pointsetup graphpoints put 2 into firsttime end mouseup on cleanup choose lasso tool domenu "select" domenu "cut picture" choose browse tool end cleanup on drawgraph choose line tool drag from 100,200 to 100,305 domenu "trace edges" choose line tool drag from 95,300 to 300,300 domenu "trace edges" choose browse tool end drawgraph on pointsetup put 1 into linecount repeat 50 putdata linecount,random(50) put linecount + 1 into linecount end repeat end pointsetup on graphpoints put 1 into horiz repeat forever if the mouse is down then exit repeat repeat 50 getdata horiz put the result into vert getprevdata horiz put the result into vert1 choose pencil tool click at 101+horiz*4,299-(100-vert) click at 101+horiz*4,299-(100-vert1) put horiz + 1 into horiz if horiz > 50 then databuff pointsetup put 1 into horiz end if end repeat end repeat choose browse tool end graphpoints -- part 2 (button) -- low flags: 00 -- high flags: 8004 -- rect: left=35 top=21 right=43 bottom=144 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: about this card ----- HyperTalk script ----- on mouseUp set visible of cd fld "about" to true end mouseUp -- part 3 (field) -- low flags: 01 -- high flags: 0007 -- rect: left=36 top=46 right=192 bottom=473 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: about ----- HyperTalk script ----- on mouseup set the visible of me to false end mouseup -- part contents for card part 3 ----- text ----- The Script in the 'Graph' button provides an example of using all four XCMD's: -the first XCMD 'PUTDATA' puts a random number between 1 and 50 into the array rsrc in 50 points. - the second XCMD 'GetData' retrieves those values The example script sets up the array and retrieves the data in a sequential fashion but random access is possible. -the third XCMD 'DataBuff' sets up a buffer array of 50 points that were just derived so that the script can erase the previous point before it plots a new one - this must be done with a fourth XCMD 'Getpreviousdata' which is identical to 'Getdata' except that it accesses data from the buffer array instead of the working array.